Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Input): fix the display issue of numbers starting with 0 #6217

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

miracles1919
Copy link
Contributor

@github-actions
Copy link
Contributor

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6217.surge.sh

// fix the display issue of numbers starting with 0
if (Number(nextValue) !== Number(boundValue)) {
nextValue = boundValue
}
Copy link
Member

@afc163 afc163 Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看上去直接 nextValue = Number(boundValue); 就行。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原本就是这样,存在一个问题,输入 '012' 的时候,nextValue = '012' ,Number(boundValue) = 12,最后展示的时候就是 12 了

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (234c083) 90.75% compared to head (13a8201) 90.75%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6217   +/-   ##
=======================================
  Coverage   90.75%   90.75%           
=======================================
  Files         304      304           
  Lines        6597     6598    +1     
  Branches     1644     1645    +1     
=======================================
+ Hits         5987     5988    +1     
  Misses        562      562           
  Partials       48       48           
Impacted Files Coverage Δ
src/components/input/input.tsx 97.46% <100.00%> (+0.03%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zombieJ zombieJ merged commit 04a59db into ant-design:master Jun 27, 2023
8 checks passed
@miracles1919 miracles1919 deleted the fix/input branch June 27, 2023 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants